package com.java46.struts2.base.entity;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Objects;

/**
 * @ClassName TOrderdetailEntity
 * @Description 订单详细信息
 * @Author zuxia
 * @Date 2018/7/17 14:38
 * @Vcrsion 1.0
 **/
@Entity
@Table(name = "t_orderdetail", schema = "fullboydb")
public class TOrderdetailEntity {
    private int oDId;
    private Integer count;
    private int cooked;
    private int orderId;
    private Integer dId;

    @Id
    @Column(name = "o_d_id")
//    @GenericGenerator(name = "t_orderdetail",strategy = "identity")
//    @GeneratedValue(generator = "t_orderdetail")
    public int getoDId() {
        return oDId;
    }

    public void setoDId(int oDId) {
        this.oDId = oDId;
    }

    @Basic
    @Column(name = "Count")
    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    @Basic
    @Column(name = "cooked")
    public int getCooked() {
        return cooked;
    }

    public void setCooked(int cooked) {
        this.cooked = cooked;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TOrderdetailEntity that = (TOrderdetailEntity) o;
        return oDId == that.oDId &&
                cooked == that.cooked &&
                Objects.equals(count, that.count);
    }

    @Override
    public int hashCode() {

        return Objects.hash(oDId, count, cooked);
    }

    @Basic
    @Column(name = "orderId")
    public int getOrderId() {
        return orderId;
    }

    public void setOrderId(int orderId) {
        this.orderId = orderId;
    }

    @Basic
    @Column(name = "dId")
    public Integer getdId() {
        return dId;
    }

    public void setdId(Integer dId) {
        this.dId = dId;
    }
}
